package org.travel.api.travel.pojo;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@Entity
@Table(name = "dictionaries")
public class Dictionaries implements Serializable {
    private Integer dicId;
    private String dicName;
    private Integer dicParentId;

    @Id
    @Column(name = "dicId", nullable = false)
    public Integer getDicId() {
        return dicId;
    }

    public void setDicId(Integer dicId) {
        this.dicId = dicId;
    }

    @Basic
    @Column(name = "dicName", nullable = false, length = 50)
    public String getDicName() {
        return dicName;
    }

    public void setDicName(String dicName) {
        this.dicName = dicName;
    }

    @Basic
    @Column(name = "dicParentId", nullable = true)
    public Integer getDicParentId() {
        return dicParentId;
    }

    public void setDicParentId(Integer dicParentId) {
        this.dicParentId = dicParentId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Dictionaries that = (Dictionaries) o;
        return Objects.equals(dicId, that.dicId) &&
                Objects.equals(dicName, that.dicName) &&
                Objects.equals(dicParentId, that.dicParentId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(dicId, dicName, dicParentId);
    }
}
